#ifndef SL_SCENE_VIEW_H_
#define SL_SCENE_VIEW_H_
#include "Config.h"
#include "Referenced.h"
#include "Node.h"
#include "Camera.h"
#include "RenderInfo.h"
#include "CullNodeVisitor.h"
#include "StateGraph.h"
#include "State.h"
namespace sl
{
//************************************************************************
// author	:	vera												
// date		:	2011/5/15 15:44 
// it inludes view, camera, rootnode. using to render operate and show all 
// the scene
//************************************************************************

class SL_EXPORT SceneView : public sl::Referenced
{
public:
	SceneView(void);
	~SceneView(void);

	void SetCamera( sl::Camera * pCamera ){ m_rCamera = pCamera; };
	sl::Camera * GetCamera(){ return m_rCamera.get(); };

	void SetSceneData( sl::Node * pNode );

	void Render( sl::Camera * pCamera, sl::Node * pSceneData );

	// 
	void Update();

	// cull the scene and find the visible object to input the StateGraph
	void Cull();

	// draw the object 
	void Draw();

private:

	sl::ref_ptr<sl::Node>				m_rSceneDate;
	sl::ref_ptr<sl::Camera>				m_rCamera;
	sl::ref_ptr<sl::CullNodeVisitor>	m_rNodeVisitor;
	sl::ref_ptr<sl::StateGraph>		m_rStateGraph;
	sl::ref_ptr<sl::RenderInfo>			m_rRenderInfo;
	
};
}
#endif
